package hacker_rank;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;

public class Triplets {

	private void solve(int[] A) {

		int n = A.length;

		int[] dp = new int[n];

		int c = 0;
		for (int i = 1; i < n; i++) {
			if(A[i] > A[0] && A[i] != A[i-1] )
				c++;
		}
		dp[0] = c;
		System.out.println(Arrays.toString(dp));

	}

	public static void main(String[] args) throws IOException {
	//	 BufferedReader br = new BufferedReader(new		 InputStreamReader(System.in));
	BufferedReader br = new BufferedReader(new FileReader(
			"C:/Users/nchumbal/Downloads/input.txt"));
		String line = br.readLine();

		int N = Integer.parseInt(line);

		int[] A = new int[N];

		line = br.readLine();
		String[] temp = line.split(" ");
		for (int i = 0; i < N; i++) {
			A[i] = Integer.parseInt(temp[i]);
		}

		Triplets tri = new Triplets();
		tri.solve(A);

		br.close();
	}

}
